package com.hjsmallfly.syllabus.ext

import android.support.v7.widget.Toolbar
import android.widget.TextView
import com.hjsmallfly.syllabus.R
import com.latsen.pawfit.ext.statusBarHeight

fun Toolbar.compat() {
    title = ""
    layoutParams.height += statusBarHeight
    setPadding(left, top + statusBarHeight, right, bottom)
}

fun Toolbar.setBackIcon() {
    setNavigationIcon(R.drawable.ic_arrow_back)
}

var Toolbar.titleText: String?
    set(value) {
        findViewById<TextView>(R.id.tv_title)?.text = value
    }
    get() = findViewById<TextView>(R.id.tv_title)?.text?.toString()
